var app = getApp();
Component({
  properties: {
        list: Array,
        params : Object,
        stylea : Number,
        info : Object,
        imgper : Number,
    },
    data: {
        showstatus : false,
        page : {
            isend : false,
            doing : false,
            doo : 'article',
            pdata : {
                op : 'indexlist',
                num : 10,
                page : 2,
                otype : 0,
                sid : 0,
                lat : 0,
                lng : 0,
            },
            waitf : 0,
            nodataf : 0,
        },
        playindex : -1,
    },
    ready:function(){
        var self = this;
        var item = self.data.info || {};
        for (var t in item) {
            self.data.page.pdata[t] = item[t];
        }
    },
    methods: {
        navigateto : function( e ){
            app.com.navigateto( e );
        },
        reset(e){
            this.data.page.isend = false;
            this.data.page.doing = false;
            this.data.page.waitf = 0;
            this.data.page.nodataf = 0;
            this.data.page.pdata.page = 1;
            this.data.list = [];
            this.load('reset');
        },
        load(e){
            var self = this;
            if(self.data.info.isdown != 1 ) return false;
            app.com.getPage(self,self.data.page,20,false,function(res){
                if(e == 'reset'){
                    self.setData({
                        list : res.data.data.list
                    });
                }else{
                    self.setData({
                        list : self.data.list.concat(res.data.data.list)
                    });
                }
            });
        },
        palythis(e){
            this.setData({
                playindex : e.currentTarget.dataset.i
            })
        }
    }

})